﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using CMD_DKT.DAL;

namespace CMD.BAL.MISC
{
    public class InsertSapLocal
    {
        public DataSet InsertSap(Dictionary<string, string> values)
        {
            try
            {
                SqlCommand sp = new SqlCommand("SP_CMD_INSERT_SAP");
                sp.CommandType = CommandType.StoredProcedure;
                foreach (KeyValuePair<string, string> d in values)
                {
                    sp.Parameters.AddWithValue(d.Key, d.Value);
                }
                return SrvDB.ExecuteCommand(sp);
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        public DataSet InsertSap_Message(Dictionary<string, string> values)
        {
            try
            {
                SqlCommand sp = new SqlCommand("SP_CMD_INSERT_SAP_MESSAGE");
                sp.CommandType = CommandType.StoredProcedure;
                foreach (KeyValuePair<string, string> d in values)
                {
                    sp.Parameters.AddWithValue(d.Key, d.Value);
                }
                return SrvDB.ExecuteCommand(sp);
            }
            catch (Exception ex)
            {
                return null;
            }
        }
    }
}
